<?php
/**
 * @fileoverview    分享页面（feed）
 * @author          zhanglei@
 * @date            Feb  02 11:31:49 CST 2012
 * @copyright       sina meila
 */
include_once ('../../__global.php');
include_once ('listBase.php');


class followList extends listBase {    
    
    
    public function main(){
        
        $uid = $this->uid;
        
        ml_tool_actionlog::add_other_action($this->__visitor['uid'] , ML_SINAACTCODE_VIEW_HOME_FOLLOWS , $uid);
        
        //    右下角我关注的人
        $uids = $this->getUids($uid,0,12);
        
        //    获得 我关注的人的 uids
        $uids = $this->getUids($uid,0);
        $data = $this->getUser($uid, $this->__visitor['uid']);
        $this->set_scope_var('$skilltags',$data['skill_tags']);
        // 找出uid的粉丝数
        //$followCnt =  $this->oCount->getFollowCnt($uid);
        $this->oFollow->countFollows($uid);  //因redis中与表中计数不一致，暂时从表中统计
        $followCnt=$this->oFollow->get_data();
        $followCnt = $followCnt > 0 ? $followCnt : 0;
        
        if($followCnt == 0) {
            $data['list'] = array();
        }else {
            $data['list'] = $this->getList($uid, $uids);
        }
        
        
        $this->set_scope_var('$totalPage', ceil($followCnt/ML_FOLLOW_PAGESIZE));//总页数
        $this->set_scope_var('$currentPage', intval($this->page));//当前页
        $title = $this->__visitor['uid'] == $uid  ? '我关注的人' :  $data['nickname'].'关注的人';
        $data['who'] = $this->__visitor['uid'] == $uid ? '我' :  '她';
        $data['title'] = $title;
        //    右下角拼出xx关注的人的Html
        $oIFollow = new ml_biz_module_iFollow();
        $data['iFollow'] = $oIFollow->getList($uid,$this->__visitor['uid']);
        
        $this->set_page_title($title);
        $this->page_output('followlist',$data);
        

    }
    
    

}
new followList();
?>